/**************************************************************************************
 *
 * @(#) LettuceConfig.java
 * @Package com.jgdt.jgdtkasannong_university_gene_backend.config.redis
 **************************************************************************************/
package com.jgdt.jgdtkasannong_university_gene_backend.config.redis;

import io.lettuce.core.ClientOptions;
import io.lettuce.core.protocol.ProtocolVersion;
import org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
/**
 * @description: redis 配置类
 * @author: huangAn
 * @createDate: 2025/04/27
 */
@Configuration
public class LettuceConfig implements LettuceClientConfigurationBuilderCustomizer {

    @Override
    public void customize(LettuceClientConfiguration.LettuceClientConfigurationBuilder clientConfigurationBuilder) {
        clientConfigurationBuilder.clientOptions(
                ClientOptions.builder()
                        .protocolVersion(ProtocolVersion.RESP2)  // 强制使用 RESP2
                        .build()
        );
    }
}




